#pragma once

class Session;
class NetworkObject
{
public:
	NetworkObject();
	virtual ~NetworkObject();

	void Disconnect(bool bGrace = true);

	bool Send(unsigned char* pMsg, size_t nSize);

	Session* GetSession() { return m_pSession;}

	void SetSession(Session* pSession) { m_pSession = pSession;}
public:
	//
	virtual void OnAccept() {}
	//
	virtual void OnDisconnect() {}
	//
	virtual void OnRecv(unsigned char* pMsg, size_t nSize) {}
private:
	Session* m_pSession;
};
